package com.wdc;

import java.util.function.IntConsumer;

public class LambdaDemo2 {


    public static void main(String[] args) {

        foreachArr((int value)-> {
            if (value == 1){
                System.out.println(value);

            }
        });
    }


    public static void foreachArr(IntConsumer intConsumer){
        int[] arr = {1,2,3,4,5,6,7,8,9};
        for (int i : arr) {
            intConsumer.accept(i);
        }
    }

}
